import request from "@/utils/request";
import { analyseUrl } from "@/api/requestVaribles";

const analysis = {
  // 点缓冲
  pointBuffer(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/geoTileAnalysis/getPointShapeBuffer`,
      method: "get",
      "x-api": 'server.core.3d-visuals.v1.search',
      params: {
        ...params,
      },
    });
  },
  // 线缓冲
  lineBuffer(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/geoTileAnalysis/getLineShapeBuffer`,
      method: "get",
      params: {
        ...params,
      },
    });
  },
  // 面缓冲
  areaBuffer(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/geoTileAnalysis/getPolygonShapeBuffer`,
      method: "get",
      params: {
        ...params,
      },
    });
  },
  /**
   *
   * @param params 地表面积测量
   */
  areaGeoMeasure(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/GisAnalysis/AreaMeasurement`,
      method: "post",
      data: params,
    });
  },

  /**
   *
   * @param params 地表长度测量
   */
  lengthGeoMeasure(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/GisAnalysis/DistanceMeasurement`,
      method: "post",
      data: params,
    });
  },

  lengthSpaceMeasure(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/GisAnalysis3D/getMultiPointsDistanceMeasurement`,
      method: "GET",
      params: params,
    });
  },

  areaSpaceMeasure(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/GisAnalysis3D/getAreaMeasurement`,
      method: "GET",
      params: params,
    });
  },

  // 线面拓扑
  linePolygonTopo(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/GisAnalysis/linePolygonTopologyAnalysis`,
      method: "post",
      data: params,
    });
  },
  // 点线拓扑
  pointLineTopo(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/GisAnalysis/pointLineTopologyAnalysis`,
      method: "post",
      data: params,
    });
  },
  /**
   *
   * @param params 剖面分析
   */
  terrainProfile(params: any) {
    return request({
      url: `${analyseUrl}/env/geo/GisAnalysis3D/terrainProfileAnalysis`,
      method: "post",
      data: params,
    });
  },
};

export default analysis;
